package ooexercise04;
public class Dog extends Animal implements Swim{
    Dog(String name,String color,int age){
        super(name,color,age);
    }

    void eat(){
        System.out.println(color+"色的"+age+"岁小狗"+name+"在啃骨头……");
    }

    public void swim(){
        System.out.println(color+"色的"+age+"岁小狗"+name+"在游泳……");
    }

    void lookHome(){
        System.out.println(color+"色的"+age+"岁小狗"+name+"在看家……");
    }
}





/*
public class Dog extends Animal implements Swim{
    Dog(String name,String color,int age){
        super(name,color,age);
    }

    void eat(){
        System.out.println(color+"色的"+age+"岁小狗"+name+"在啃骨头……");
    }

    public void swim(){
        System.out.println(color+"色的"+age+"岁小狗"+name+"在游泳……");
    }

    void lookHome(){
        System.out.println(color+"色的"+age+"岁小狗"+name+"在看家……");
    }
}

 */
